
#include <windows.h>
#include <iostream>
#include "Sim.h"
#include "Graphics.h"

using namespace std;

Sim* sim;
Graphics* gfx;

/*----------------------------------------------------------------------------*/
DWORD startSim(LPVOID) {
	sim->start();
	return 0;
}

/*----------------------------------------------------------------------------*/
int main(int argc, char *argv[]) {

	sim = new Sim();
	gfx = new Graphics(argc, argv, sim);

	DWORD threadId;
	HANDLE simThread = CreateThread(NULL,0,
		(LPTHREAD_START_ROUTINE)startSim,NULL,0,&threadId);
	if ( simThread == NULL ) { cout << "SimThread Creation Failed!" << endl; }

	gfx->start();

	WaitForSingleObject(simThread, INFINITE);

	return 0;
}